﻿@* Ui层项目 - 业务路由模块文件 *@
@using Util.Generators.Helpers
@model Util.Generators.Contexts.EntityContext
@{
    var service = new GenerateService( Model );
    Model.Output.FileNameNoExtension = "routes-routing.module";
    Model.Output.Extension = ".ts";
    Model.Output.RelativeRootPath = $"src/{service.GetUiProjectName()}/ClientApp/src/app/routes";
}
import { NgModule } from '@@angular/core';
import { RouterModule, Routes } from '@@angular/router';
import { AuthGuard } from 'util-angular';
import { environment } from '@@env/environment';
import { LayoutBasicComponent } from '../layout/basic/basic.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import {routes as @service.GetClientRoutesName() } from "./@service.GetClientModuleFolderName()/@service.GetClientRoutingModuleFileName()";

const routes: Routes = [
  {
    path: '',
    component: LayoutBasicComponent,
    //canActivate: [AuthGuard],
    //canActivateChild: [AuthGuard],
    children: [
      { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
      { path: 'dashboard', component: DashboardComponent, data: { title: '仪表盘', titleI18n: 'dashboard' } },
      { path: 'exception', loadChildren: () => import('./exception/exception.module').then(m => m.ExceptionModule) },
      { path: '@service.GetClientModuleRoutePath()', children: @service.GetClientRoutesName() }
    ]
  },
  { path: '**', redirectTo: 'exception/404' },
];

@@NgModule({
  imports: [
    RouterModule.forRoot(
      routes, {
        useHash: environment.useHash,
        scrollPositionRestoration: 'top',
      }
    )],
  exports: [RouterModule],
})
export class RouteRoutingModule { }
